package cn.js.sangu.unitStore.entity;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 说明：系统公告表
 * 作者：linshuo
 * 日期：2024/10/29 9:10
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("notice")
public class Notice {
    @TableId(type = IdType.AUTO)
    private Integer id;

    @Alias("标题")
    private String title;

    @Alias("内容")
    private String content;

    @Alias("用户ID")
    private Integer userId;

    @Alias("用户名")
    private String username;

    @Alias("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date creatTime;

    @Alias("更新人ID")
    private Integer modifier;

    @Alias("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date updateTime;

    @Alias("是否公开")
    private Boolean isOpen;

    @Alias("备注")
    private String remark;

}
